<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% logging_metric = grab_attributes(pwd)['logging_metric'] -%>
describe google_project_metric(project: <%= gcp_project_id -%>, name: <%= doc_generation ? "'#{logging_metric['name']}'" : "logging_metric['name']" -%>) do
  it { should exist }
  its('filter') { should cmp <%= doc_generation ? "'#{logging_metric['filter']}'" : "logging_metric['filter']" -%> }
  its('metric_descriptor.metric_kind') { should cmp <%= doc_generation ? "'#{logging_metric['metric_kind']}'" : "logging_metric['metric_kind']" -%> }
  its('metric_descriptor.value_type') { should cmp <%= doc_generation ? "'#{logging_metric['value_type']}'" : "logging_metric['value_type']" -%> }
end

describe google_project_metric(project: <%= gcp_project_id -%>, name: 'nonexistent') do
  it { should_not exist }
end